// 所有tabbar页面
import {
  myNavigateTo
} from "."
import {
  useUserStore
} from "../store/useUserStore"
export const tabbarList = ['/pages/shouye/shouye', '/pages/xiaoxi/xiaoxi', '/pages/wode/wode']

// 快速访问菜单
export const menus = [{
  icon: '/static/my/wode9.svg',
  name: '个人信息',
  clickTodo() {
    myNavigateTo('/subpkg/myother/writeInfo/index/index')
  }
}, {
  icon: '/static/my/wode1.svg',
  name: '订单',
  clickTodo() {
    myNavigateTo('/subpkg/myother/order/index/index')
  }
}, {
  icon: '/static/my/wode2.svg',
  name: '我的发布',
  clickTodo() {
    myNavigateTo('/subpkg/myother/fabu/index/index')
  }
}, {
  icon: '/static/my/wode3.svg',
  name: '我的地址',
  clickTodo() {
    myNavigateTo('/subpkg/myother/address/index/index')
  }
}, {
  icon: '/static/my/wode4.svg',
  name: '乘车人信息',
  clickTodo() {
    myNavigateTo('/subpkg/myother/rider/index/index')
  }
}, {
  icon: '/static/my/wode5.svg',
  name: '收藏',
  clickTodo() {
    myNavigateTo('/subpkg/myother/collect/index/index')
  }
}, {
  icon: '/static/my/wode6.svg',
  name: '联系与反馈',
  clickTodo() {
    myNavigateTo('/subpkg/myother/feedback/feedback')
  }
},
// {
//   icon: '/static/my/wode7.svg',
//   name: '设置',
//   clickTodo() {
//     myNavigateTo('/pages/shouye/shouye')
//   }
// }, 
{
  icon: '/static/my/wode8.svg',
  name: '退出登录',
  clickTodo() {
    // 退出登录
    wx.showModal({
      title: '退出登录',
      content: '是否确定要继续操作？',
      showCancel: true, // 是否显示取消按钮
      success(res) {
        if (res.confirm) {
          const userStore = useUserStore()
          userStore.clearUserInfo()
          uni.removeStorageSync('userId')
          uni.navigateTo({
            url: '/otherpages/index/login/login'
          })
        } else if (res.cancel) {
          console.log('用户点击取消');
        }
      },
      fail(error) {
        console.log('调用失败', error);
      }
    })
  }
}, ]